interface dogType {
    name: string,
    age: number
}

// type dogType = {
//     name: string,
//     age: number
// }

class Dog implements dogType{
    // constructor 构造函数 （会在对象创建时调用）
    name: string
    age: number
    constructor (name: string, age: number) {
        this.name = name
        this.age = age
    }
    // name = '旺财'
    // age = 18
    bark() {
        console.log('汪汪汪！')
    }
}
const dog = new Dog('xiaohei', 11)
console.log('ssss', dog.bark())